home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June / CHIP 2006-06.2.iso / program / freeware / Democracy-0.8.2.exe / xulrunner / python / compiled_templates / channel_item_header.py < prev    next >
Encoding:
Python Source  |  2006-04-10  |  3.8 KB  |  62 lines

  1. # This is a generated file. Do not edit.
  2. from template import Handle, fillAttr, quoteAndFillAttr, funcTable
  3. from IOBuffer import IOBuffer
  4. from xhtmltools import urlencode
  5. from templatehelper import quoteattr, escape, evalKey, toUni
  6. def fillTemplate(data, domHandler):
  7.     # Start of handle
  8.     handle = Handle(domHandler)
  9.  
  10.  
  11.     out = IOBuffer()
  12.     out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n")
  13.     out.write(u'<html dtvPlatform="')
  14.     out.write(quoteattr(urlencode(toUni(evalKey(u'dtvPlatform',data)))))
  15.     out.write(u'" eventCookie="')
  16.     out.write(quoteattr(urlencode(toUni(evalKey(u'eventCookie',data)))))
  17.     out.write(u'" xmlns:t=')
  18.     out.write(quoteAndFillAttr(u'http://www.participatorypolitics.org/',data))
  19.     out.write(u' xmlns=')
  20.     out.write(quoteAndFillAttr(u'http://www.w3.org/1999/xhtml',data))
  21.     out.write(u' xmlns:i18n=')
  22.     out.write(quoteAndFillAttr(u'http://www.participatoryculture.org/i18n',data))
  23.     out.write(u'>\n\n    <head>\n        <meta content=')
  24.     out.write(quoteAndFillAttr(u'text/html; charset=utf-8',data))
  25.     out.write(u' http-equiv=')
  26.     out.write(quoteAndFillAttr(u'content-type',data))
  27.     out.write(u'></meta>\n    </head>\n\n    <body>\n        \n\t\t\t\t<div class=')
  28.     out.write(quoteAndFillAttr(u'main-video-container',data))
  29.     out.write(u'>\n\t\t\t\t\t<div class=')
  30.     out.write(quoteAndFillAttr(u'main-video-content',data))
  31.     out.write(u'>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=')
  32.     out.write(quoteAndFillAttr(u'main-video-tnail',data))
  33.     out.write(u'>\n\t\t\t\t\t\t\t\t<img src="')
  34.     out.write(quoteattr(toUni(evalKey(u'this getThumbnail',data))))
  35.     out.write(u'" alt=')
  36.     out.write(quoteAndFillAttr(u'',data))
  37.     out.write(u'></img>\n\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t<div class=')
  38.     out.write(quoteAndFillAttr(u'main-video-hitbox',data))
  39.     out.write(u'>\n\t\t\t\t\t\t\t\t')
  40.     if evalKey(u'global filter substring', data)(evalKey(u'this getState', data), u'stopped'):
  41.         for (func, args) in [(0, u'<span class='), (10, u'downloadable'), (0, u'>\n\t\t\t\t\t\t\t\t\t\t<a href='), (10, u'#'), (0, u' onclick="return eventURL(\'action:startDownload?item='), (2, u'this getID'), (0, u'\');" title="Download \''), (8, u'this getTitle'), (0, u'\'"></a>\n\t\t\t\t\t\t\t\t</span>')]:
  42.             out.write(funcTable[func](data,'',args))
  43.     out.write(u'\n\t\t\t\t\t\t\t\t')
  44.     if evalKey(u'global filter substring', data)(evalKey(u'this getState', data), u'downloading'):
  45.         for (func, args) in [(0, u'<span class='), (10, u'inprogress'), (0, u'>\n\t\t\t\t\t\t\t\t\t\t<a href='), (10, u'#'), (0, u' title='), (10, u''), (0, u'></a>\n\t\t\t\t\t\t\t\t</span>')]:
  46.             out.write(funcTable[func](data,'',args))
  47.     out.write(u'\n\t\t\t\t\t\t\t\t')
  48.     if evalKey(u'global filter substring', data)(evalKey(u'this getState', data), u'finished'):
  49.         for (func, args) in [(0, u'<span class='), (10, u'playable'), (0, u'>\n\t\t\t\t\t\t\t\t\t\t<a href='), (10, u'#'), (0, u' onclick="return eventURL(\'action:playViewNamed?viewName='), (2, u'thisView'), (0, u'&firstItemId='), (2, u'this getID'), (0, u'\');" title="Play \''), (8, u'this getTitle'), (0, u'\'"></a>\n\t\t\t\t\t\t\t\t</span>')]:
  50.             out.write(funcTable[func](data,'',args))
  51.     out.write(u'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=')
  52.     out.write(quoteAndFillAttr(u'main-video-desc',data))
  53.     out.write(u'>\n\t\t\t\t\t\t\t\t<h1>')
  54.     out.write(escape(evalKey(u'this getTitle',data)))
  55.     out.write(u'</h1>\n\t\t\t\t\t\t\t\t<p>')
  56.     out.write(toUni(evalKey(u'this getDescription',data)))
  57.     out.write(u'</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n        \n    </body>\n\n</html>')
  58.     out.close()
  59.  
  60.  
  61.     return (out, handle)
  62.